<?php


@include_once("connect.php");

$res = [];

// $name = $_POST["username"];
$pwd = $_POST["password"];
$tell = $_POST["tellnumber"];

if ($tell && $pwd) {
  $sql = "SELECT * FROM user WHERE tellnumber= '$tell'";
  $gettab = mysqli_query($con, $sql);
  $arr = mysqli_fetch_array($gettab);
  if ($arr) {
    if ($arr["password"] == $pwd) {
      $res["status"] = true;
      $res["mag"] = "登入成功";
    } else {
      $res["status"] = false;
      $res["mag"] = "账户或密码错误";
    }
  } else {
    $res["status"] = false;
    $res["mag"] = "请输入正确手机号";
  }
} else {
  $res["status"] = false;
  $res["mag"] = "前端数据请求失败";
}
echo (json_encode($res,JSON_UNESCAPED_UNICODE));
